<template>
  <h1>单选组件</h1>
  <el-radio-group v-model="msg">
    <el-radio value="幼本" label="学历:幼本"></el-radio>
    <el-radio value="小学" label="学历:小学"></el-radio>
    <el-radio value="初中" label="学历:初中"></el-radio>
    <el-radio value="硕士" label="学历:硕士"></el-radio>
    <el-radio value="博士" label="学历:博士"></el-radio>
  </el-radio-group>
  <h4>选择的是{{ msg }}</h4>
  <br>
  <el-radio-group v-model="msg2">
    <el-radio-button v-for="item in list" :label="item.name" :value="item.age"></el-radio-button>
  </el-radio-group>
  <h4>选择的是{{ msg2 }}</h4>
</template>
<script setup>
import {ref} from "vue";
//设置默认值
const msg = ref('幼本');

const list = ref([
  {name: "黄霄雲", age: 18},
  {name: "孙雪宁", age: 19},
  {name: "李庚希", age: 20},
  {name: "毛晓彤", age: 21},
]);
//设置默认值
const msg2 = ref(20);

</script>
<style scoped>

</style>